Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Csproj pack infra for packages with ref and runtime assemblies and symbols. #54250

Merged
merged 4 commits into from
Jul 2, 2021
Merged

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Jun 15, 2021

  • use nuget feed for nuget pack tasks.
  • targets for adding ref assemblies, runtime assemblies, ref symbols and runtime symbols.

@ghost
Copy link

ghost commented Jun 15, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details
  • use nuget feed for nuget pack tasks.
  • targets for adding ref assemblies, runtime assemblies, ref symbols and runtime symbols.
Author: Anipik
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@Anipik Anipik closed this Jun 16, 2021
@Anipik Anipik reopened this Jun 16, 2021
Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move the packaging related infrastructure into the packaging.props/targets files instead?

@Anipik
Copy link
Contributor Author

Anipik commented Jun 25, 2021

The file differences are

  • dotnet pack appends the filename to the item
  • removes empty exclude items.

@Anipik
Copy link
Contributor Author

Anipik commented Jun 25, 2021

@ericstj @ViktorHofer @safern can you take another look at this.

eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
eng/packaging.targets Outdated Show resolved Hide resolved
@ViktorHofer
Copy link
Member

Should this section be removed now?

<!-- TODO: Remove this after https://github.com/NuGet/NuGet.Client/pull/3980 is merged.-->
<Target Name="RemoveXmlFilesFromBuildOutput" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.dll;.exe;.winmd;.json;.pri;</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>.pdb;.mdb;$(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
</PropertyGroup>
</Target>

@Anipik
Copy link
Contributor Author

Anipik commented Jul 1, 2021

E:\>git diff temp1.nuspec Temp2.nuspec
diff --git a/temp1.nuspec b/Temp2.nuspec
index 37549f3..21cdb36 100644
--- a/temp1.nuspec
+++ b/Temp2.nuspec
@@ -1,16 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
-  <metadata minClientVersion="2.12">
+<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
+  <metadata>
     <id>System.Windows.Extensions</id>
     <version>6.0.0-dev</version>
-    <title>System.Windows.Extensions</title>
     <authors>Microsoft</authors>
-    <owners>microsoft,dotnetframework</owners>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
     <license type="expression">MIT</license>
+    <licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
     <icon>Icon.png</icon>
     <projectUrl>https://dot.net/</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
     <description>Provides miscellaneous Windows-specific types

 Commonly Used Types:
@@ -21,42 +18,33 @@ System.Security.Cryptography.X509Certificates.X509SelectionFlag</description>
     <serviceable>true</serviceable>
     <repository type="git" url="https://github.com/dotnet/runtime" commit="0000000000000000000000000000000000000000" />
     <dependencies>
-      <group targetFramework=".NETCoreApp6.0">
-        <dependency id="System.Drawing.Common" version="6.0.0-dev" />
+      <group targetFramework="net6.0">
+        <dependency id="System.Drawing.Common" version="6.0.0-dev" exclude="Build,Analyzers" />
       </group>
       <group targetFramework=".NETCoreApp3.1">
-        <dependency id="System.Drawing.Common" version="6.0.0-dev" />
+        <dependency id="System.Drawing.Common" version="6.0.0-dev" exclude="Build,Analyzers" />
       </group>
     </dependencies>
   </metadata>
   <files>
-    <file src="artifacts\bin\System.Windows.Extensions\ref\net6.0-Debug\System.Windows.Extensions.dll" target="ref\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\ref\net6.0-Debug\System.Windows.Extensions.pdb" target="ref\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\ref\netcoreapp3.1-Debug\System.Windows.Extensions.dll" target="ref\netcoreapp3.1" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\ref\netcoreapp3.1-Debug\System.Windows.Extensions.pdb" target="ref\netcoreapp3.1" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="ref\net6.0" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="ref\netcoreapp3.1" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="runtimes\win\lib\net6.0" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="runtimes\win\lib\netcoreapp3.1" exclude="" />
-
-
-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.dll" target="lib\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.pdb" target="lib\net6.0" exclude="" />
+    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.dll" target="lib\net6.0\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.pdb" target="lib\net6.0\System.Windows.Extensions.pdb" />

-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.dll" target="lib\netcoreapp3.1" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.pdb" target="lib\netcoreapp3.1" exclude="" />
+    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.dll" target="lib\netcoreapp3.1\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.pdb" target="lib\netcoreapp3.1\System.Windows.Extensions.pdb" />

-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.pdb" target="runtimes\win\lib\net6.0" exclude="" />
+    <file src="artifacts\obj\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\net6.0\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.pdb" target="\runtimes\win\lib\net6.0\System.Windows.Extensions.pdb" />

-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\netcoreapp3.1" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.pdb" target="runtimes\win\lib\netcoreapp3.1" exclude="" />
-
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\net6.0" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\netcoreapp3.1" exclude="" />
+    <file src="artifacts\obj\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\netcoreapp3.1\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.pdb" target="\runtimes\win\lib\netcoreapp3.1\System.Windows.Extensions.pdb" />
+
+    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\net6.0\System.Windows.Extensions.xml" />
+    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\netcoreapp3.1\System.Windows.Extensions.xml" />

-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21321.1\tools\Assets\DotNetPackageIcon.png" target="Icon.png" exclude="" />
-    <file src="LICENSE.TXT" target="LICENSE.TXT" exclude="" />
-    <file src="THIRD-PARTY-NOTICES.TXT" target="THIRD-PARTY-NOTICES.TXT" exclude="" />
+    <file src="C:\Users\anagniho\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21321.1\tools\Assets\DotNetPackageIcon.png" target="Icon.png" />
+    <file src="LICENSE.TXT" target="LICENSE.TXT" />
+    <file src="THIRD-PARTY-NOTICES.TXT" target="THIRD-PARTY-NOTICES.TXT" />
+    <file src="eng\useSharedDesignerContext.txt" target="useSharedDesignerContext.txt" />
   </files>
 </package>
\ No newline at end of file

updated diff of removing ref and runtime xml files,
adding useSharedDesignerContext to all the packages as well.

delete the project

add a comment

move the warning disable to cenral location

moving props/targets to packaging.props and packaging.targets

use intellisense package for ref and runtime xml files

add comments, flag for ref assemblies, remove xml from runtimes, use outputItem to get the reference assembly

addressing some more feedback

remove ref assemblies

add suppression file and update package validatio
Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great now. Feel free to merge after you updated the PackageValidation version again to the latest. Also should we set up a subscription now to keep the bits flowing?

@Anipik
Copy link
Contributor Author

Anipik commented Jul 2, 2021

created issue #55085 for failing unrelated test

@Anipik Anipik merged commit b26d811 into dotnet:main Jul 2, 2021
Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants